from day07.Employees import Employee

list_employees = [
    Employee(1001, 9002, "师父", 60000),
    Employee(1002, 9001, "孙悟空", 50000),
    Employee(1003, 9002, "猪八戒", 20000),
    Employee(1004, 9001, "沙僧", 30000),
    Employee(1005, 9001, "小白龙", 15000),
]
emp01 = max(list_employees,key=lambda emp:emp.money)
print(emp01)
print("===============================")
emp02 = min(list_employees,key=lambda emp:emp.money)
print(emp02)
print("===============================")
emp03 = filter(lambda emp:emp.money>45000,list_employees)
for i in emp03:
    print(i)
print("===============================")
emp04 = map(lambda emp:emp.name,list_employees)
for i in emp04:
    print(i)
print("===============================")
emp05 = sorted(list_employees,key=lambda item:item.money)
emp06 = sorted(list_employees,key=lambda item:item.money,reverse=True)
for i in emp05:
    print(i)
print("===============================")
for i in emp06:
    print(i)